package com.simtop.controller;

import com.simtop.common.ServerResponse;
import com.simtop.pojo.experiment.Echarts2;
import com.simtop.pojo.experiment.Echarts3;
import com.simtop.service.EchartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Classname EchartsController
 * @Description TODO
 * @Date 2022/1/5 9:10
 * @Created by lzb
 */
@Controller
@RequestMapping("/user/echarts")
@CrossOrigin
public class EchartsController {

    @Autowired
    private EchartsService echartsService;

    /**
     * 查询前八的省份用户数量
     * @param
     * @return
     */
    @RequestMapping(value = "/userArea",method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse<List> userAreaCount(){

        return echartsService.selectEightProUser();
    }


    /*
    *
     *功能描述 用户数量统计分析
     * @author lzb
     * @date 2022/1/5
     * @param
     * @return
     */
/*
    @RequestMapping(value = "role" , method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse<List<Echarts2>> selectRoleUser(){
        return echartsService.selectRoleUser();

    }
*/

    /**
     * 用户实验成绩分布图
     * @param request
     * @return
     */
    @RequestMapping(value = "/score",method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse<Echarts3> selectScoreUser(HttpServletRequest request, HttpServletResponse response){

                 return echartsService.selectScoreUser();

    }


}
